package cn.com.api.mapper.base;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import cn.com.api.entity.ApiU_chat_msg;

//DAO
public interface U_chat_msgMapperBase {

	// 根据id查看
	@Select("SELECT * FROM U_CHAT_MSG ")
	public ApiU_chat_msg findU_chat_msgById(Integer id);

	// 查看数据集
	@Select("SELECT * FROM U_chat_msg")
	public List<ApiU_chat_msg> findU_chat_msgs();

	// 根据条件查看数据集
	public List<Map<String, Object>> findU_chat_msgsByMap(HashMap condition);

	// 添加
	@Insert("INSERT INTO U_CHAT_MSG (FROM_UID, TO_UID, ADD_TIME, IS_DEAL, TYPE, CONTENT) VALUES (#{from_uid}, #{to_uid}, #{add_time}, #{is_deal}, #{type}, #{content})")
	@Options(useGeneratedKeys = true, keyProperty = "id")
	public int insertU_chat_msg(ApiU_chat_msg u_chat_msg);

	// 修改
	@Update("UPDATE U_CHAT_MSG SET ID = #{id}, FROM_UID = #{from_uid}, TO_UID = #{to_uid}, ADD_TIME = #{add_time}, IS_DEAL = #{is_deal}, TYPE = #{type}, CONTENT = #{content}")
	public int updateU_chat_msg(ApiU_chat_msg u_chat_msg);

	// 删除
	@Delete("DELETE FROM U_CHAT_MSG ")
	public int deleteU_chat_msg(Integer id);

	// Foreign keys revelant

	// region Indexs revelant

}
